package myAsm;

import java.util.Map;

import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Transient;

import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;


@Entity
@DiscriminatorValue("INSN_MULTIANEWARRAY")
public class MyMultiANewArrayInsnNode extends MyAbstractInsnNode {

	 /**
     * An array type descriptor (see {@link org.objectweb.asm.Type}).
     */
	@Transient
    public String desc;

    /**
     * Number of dimensions of the array to allocate.
     */
	@Transient
    public int dims;

	public MyMultiANewArrayInsnNode() {
	        super(-1);
	    }
	
    /**
     * Constructs a new {@link MultiANewArrayInsnNode}.
     * 
     * @param desc an array type descriptor (see {@link org.objectweb.asm.Type}).
     * @param dims number of dimensions of the array to allocate.
     */
    public MyMultiANewArrayInsnNode(final String desc, final int dims) {
        super(Opcodes.MULTIANEWARRAY);
        this.desc = desc;
        this.dims = dims;
    }

    public int getType() {
        return MULTIANEWARRAY_INSN;
    }

    public void accept(final MethodVisitor mv) {
        mv.visitMultiANewArrayInsn(desc, dims);
    }

    public MyAbstractInsnNode clone(final Map labels) {
        return new MyMultiANewArrayInsnNode(desc, dims);
    }

}